package com.myresume.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.myresume.contact.SendMail;
import com.opensymphony.xwork2.ActionSupport;

public class mailingAction extends ActionSupport implements ServletRequestAware{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String gname;
	private String gmail;
	private String gphone;
	private String gtext;
	
	public String getGname() {
		return gname;
	}

	public void setGname(String gname) {
		this.gname = gname;
	}

	public String getGmail() {
		return gmail;
	}

	public void setGmail(String gmail) {
		this.gmail = gmail;
	}

	public String getGphone() {
		return gphone;
	}

	public void setGphone(String gphone) {
		this.gphone = gphone;
	}

	public String getGtext() {
		return gtext;
	}

	public void setGtext(String gtext) {
		this.gtext = gtext;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		String mailInfo = "Name ： "+gname+"<br>"+"Mail :　"+gmail+"<br>"+"Phone : "+gphone+"<br>"+"Msg : "+gtext;
		System.out.println("===================="+mailInfo);
		SendMail.sendMe2MeMail(mailInfo);
		return "success";
	}

	@Override
	public void setServletRequest(HttpServletRequest arg0) {
	}

}
